package LeetCode刷题;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2022-03-15 10:56
 * @description: Functions of this class is
 * 官方题解：
 * class Solution {
 *     private int ans = 0;
 *     public int diameterOfBinaryTree(TreeNode root) {
 *         depth(root);
 *         return ans;
 *     }
 *     public int depth(TreeNode cur){
 *         if(cur==null){
 *             return 0;
 *         }
 *         int leftDepth = depth(cur.left);
 *         int rightDepth = depth(cur.right);
 *         ans = Math.max(ans,leftDepth+rightDepth);
 *         return Math.max(leftDepth,rightDepth)+1;
 *     }
 *
 * }
 **/
public class No二叉树的直径联系二叉树中的最大路径和 {
    public static void main(String[] args) {

    }
}